package com.springmvc.service;

import com.springmvc.dao.NewsMapper;
import com.springmvc.entity.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * Created by 29047 on 2017/12/25.
 */
@Service
public class NewsService {

    @Autowired
    private NewsMapper newsMapper;

    public int deleteByPrimaryKey(Integer id){
        return newsMapper.deleteByPrimaryKey(id);
    }

    public int insert(News record){
        return newsMapper.insert(record);
    }

    public int insertSelective(News record){
        return newsMapper.insertSelective(record);
    }

    public News selectByPrimaryKey(Integer id){
        return newsMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(News record){
        return newsMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKeyWithBLOBs(News record){
        return newsMapper.updateByPrimaryKeyWithBLOBs(record);
    }

    public int updateByPrimaryKey(News record){
        return newsMapper.updateByPrimaryKey(record);
    }

    public ArrayList<News> selectFirstNum(int num){
        return newsMapper.selectFirstNum(num);
    }

    public int getStickCount(){
        return newsMapper.getStickCount();
    }

    public ArrayList<News> selectByType(int type){
        return newsMapper.selectByType(type);
    }
}
